import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/style/style.scss'
import '@/utils/rem.js'
import './plugin'
import { Toast } from 'vant'
import bus from '@/utils/bus.js'
import Directive from '@/directives/index'
// 自定义指令
Vue.use(Directive)
// 定义 bus
Vue.prototype.$bus = bus

// 定义路由跳转
Vue.prototype.goto = function (url) {
  if (!url) {
    Toast('快马加鞭开发中...')
  } else {
    router.push(url)
  }
}

Vue.config.productionTip = false

if (process.env.NODE_ENV === 'development') {
  Vue.config.devtools = true
}

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
